package com.bj58.mis.apm.server.statistics.conf;

import com.bj58.mis.apm.server.statistics.mock.interceptor.MockInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author: zhangfx
 * @create: 2018-06-20 18:11
 **/
@Configuration
@Profile("mock")
public class MockInterceptorsConfig implements WebMvcConfigurer {

    @Bean
    public MockInterceptor mockInterceptor(){
        return new MockInterceptor();
    }

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(mockInterceptor()).addPathPatterns("/**");
    }
}
